package com.haikesi.api.user.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * @ClassName UserSearchVO
 * @Author HandsomeBugs
 * @Date 2019/4/28 13:57
 * @Version 1.0
 **/

@ApiModel(description = "查询参数")
@Data
@EqualsAndHashCode(callSuper = false)
public class UserSearchVO implements Serializable {
    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value = "用户名称", hidden = false)
    private String userName;

    @ApiModelProperty(value = "登录名称", hidden = false)
    private String loginName;

    @ApiModelProperty(value = "手机号", hidden = false)
    private String userMobile;

    @ApiModelProperty(value = "电子邮箱", hidden = false)
    private String userEmail;

    @ApiModelProperty(value = "角色ID")
    private String roleId;
    @ApiModelProperty(value = "角色名称")
    private String roleName;
    @ApiModelProperty(value = "机构名称")
    private String organizationName;

    @ApiModelProperty(value = "页数")
    private Integer pageNum;
    @ApiModelProperty(value = "每页行数")
    private Integer pageSize;

    @ApiModelProperty(value = "组织机构ID",hidden = true)
    private String organizationId;

    public Integer getPageNum() {
        if(pageNum == null){
            pageNum = 1;
        }
        return pageNum;
    }
    public Integer getPageSize() {
        if(pageSize == null){
            pageSize = 20;
        }
        if(pageSize > 100){
            pageSize = 100;
        }
        return pageSize;
    }
}
